﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class SteamTranslateController  
{

    internal static Dictionary<SystemLanguage, string> steam_language = new Dictionary<SystemLanguage, string>() 
    {
        { SystemLanguage.Afrikaans,"" }, { SystemLanguage.Arabic,"arabic" }, { SystemLanguage.Basque,"" },{ SystemLanguage.Belarusian,"" },
        { SystemLanguage.Bulgarian,"bulgarian" }, { SystemLanguage.Catalan,"" },{ SystemLanguage.Chinese,"" },{ SystemLanguage.Czech,"czech" },
        { SystemLanguage.Danish,"danish" },{ SystemLanguage.Dutch,"dutch" },{ SystemLanguage.English,"english" },{ SystemLanguage.Estonian,"" },
        { SystemLanguage.Faroese,"" }, { SystemLanguage.Finnish,"finnish" }, { SystemLanguage.French,"french" },{ SystemLanguage.German,"german" },
        { SystemLanguage.Greek,"greek" },{ SystemLanguage.Hebrew,"" },{ SystemLanguage.Icelandic,"" },{ SystemLanguage.Indonesian,"indonesian" },
        { SystemLanguage.Italian,"italian" },{ SystemLanguage.Japanese,"japanese" },{ SystemLanguage.Korean,"koreana" },{ SystemLanguage.Latvian,"" },
        { SystemLanguage.Lithuanian,"" }, { SystemLanguage.Norwegian,"norwegian" },{ SystemLanguage.Polish,"polish" },{ SystemLanguage.Portuguese,"portuguese" },
        { SystemLanguage.Romanian,"romanian" }, { SystemLanguage.Russian,"russian" }, { SystemLanguage.SerboCroatian,"" },{ SystemLanguage.Slovak,"" },
        { SystemLanguage.Slovenian,"" },{ SystemLanguage.Spanish,"spanish" },{ SystemLanguage.Swedish,"swedish" },{ SystemLanguage.Thai,"thai" },
        { SystemLanguage.Turkish,"turkish" },{ SystemLanguage.Ukrainian,"ukrainian" },{ SystemLanguage.Vietnamese,"vietnamese" },
        { SystemLanguage.ChineseSimplified,"schinese" },{ SystemLanguage.ChineseTraditional,"tchinese" }, { SystemLanguage.Hungarian,"hungarian" },
    };


    public static string GetSteamLanguage(SystemLanguage language) { 

        if(steam_language.ContainsKey(language))
            return steam_language[language];

        return string.Empty ;
    }

    public static SystemLanguage GetSystemLanguage(string language) {

        if (string.IsNullOrEmpty(language))
            return SystemLanguage.Unknown;

        foreach (var item in steam_language.Keys)
        {
            if (steam_language[item] == language)
                return item;
        }

        return SystemLanguage.Unknown;
    }

}
